package com.weixin.paleituo.adapter;

import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.ComAdapter;
import com.weixin.paleituo.bean.RoomsBean;
import com.weixin.paleituo.help.ViewHolder;
import com.weixin.paleituo.util.UIUtils;

import java.util.List;

/**
 * Author yichao
 * Time  2018/1/12 9:27
 * Dest  售房GridViewAdapter
 */
public class SaleHouseStatusGridViewAdapter extends ComAdapter<RoomsBean> {

    public SaleHouseStatusGridViewAdapter(Context context, List<RoomsBean> strings) {
        super(context,strings,R.layout.item_lease_house_layout);

    }
    @Override
    public void convert(ViewHolder holder,RoomsBean item, int position) {
        TextView itemView = holder.getItemView(R.id.tv_item_lease_house_layout);
      RelativeLayout relativeLayout= holder.getItemView(R.id.rl_item_lease_house_layout);
        if (item.getIsSold()==0){
            //未售
            relativeLayout.setBackgroundColor(UIUtils.getColor(R.color.c_ff7ef7bc));
        }else if (item.getIsSold()==1){
            //预定
            relativeLayout.setBackgroundColor(UIUtils.getColor(R.color.c_fff7f17e));
        }else if (item.getIsSold()==2){
            //已收
            relativeLayout.setBackgroundColor(UIUtils.getColor(R.color.c_f77e86));
        }else if (item.getIsSold()==3){

            relativeLayout.setBackgroundColor(UIUtils.getColor(R.color.c_fff7f17e));
        }

        itemView.setText(item.getRoom());










    }
}
